package sel.me.spring.boot245.web.exception;

public class UnifyStrErrorCode {

	public static final UnifyStrErrorCode NULL = create("NULL", "-9999999");
	public static final UnifyStrErrorCode SUCCESS = create("成功", "200");
	public static final UnifyStrErrorCode COMMON_ERROR = create("通用失败", "400");
	public static final UnifyStrErrorCode PARAM_ERROR = create("参数不正确", "500");
	public static final UnifyStrErrorCode FORBIDDEN = create("访问被拒绝", "403");
	public static final UnifyStrErrorCode DB_ERROR = create("服务繁忙,请重试.", "501");
	public static final UnifyStrErrorCode SERVICE_ERROR = create("服务繁忙,请重试.", "500");
	public static final UnifyStrErrorCode REMOTE_SERVER_ERROR = create("服务调用异常", "-500");
	public static final UnifyStrErrorCode UN_LOGIN = create("未登录", "401");


	private String errorCode;
	private String errorMsg;

	public static UnifyStrErrorCode create(String errorMsg, String errorCode) {
		return new UnifyStrErrorCode(errorCode, errorMsg);
	}

	public UnifyStrErrorCode(String errorCode, String errorMsg) {
		this.errorCode = errorCode;
		this.errorMsg = errorMsg;
	}

	public String getErrorCode() {
		return errorCode;
	}

	public String getErrorMsg() {
		return errorMsg;
	}
}
